using JSOCTNetSDK.XmppModelFun;
using JSST.Framework.DBAccess;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;

namespace JSOCTNetSDK.XmppTask
{
	public class TaskInfo
	{
		public static System.Collections.Generic.List<T> GetSyncList<T>(string TableName) where T : class, new()
		{
			DataTable syncTable = TaskInfo.GetSyncTable(TableName);
			return syncTable.ToList<T>();
		}

		private static DataTable GetSyncTable(string TableName)
		{
			int num = 0;
			SqlParameter[] array = new SqlParameter[]
			{
				new SqlParameter("@TotalCount", SqlDbType.Int),
				new SqlParameter("@CountPerPage", SqlDbType.Int),
				new SqlParameter("@CurrentPageIndex", SqlDbType.Int),
				new SqlParameter("@Filter", SqlDbType.NVarChar, 2000),
				new SqlParameter("@TableName", SqlDbType.NVarChar, 100)
			};
			array[num++].Direction = ParameterDirection.Output;
			array[num++].Value = 1000;
			array[num++].Value = 1;
			array[num++].Value = " 1=1 ";
			array[num++].Value = TableName;
			DataTable dataTable = MSSQL.GetDataTable("SP_Common_GetAll", array);
			dataTable.TableName = TableName;
			return dataTable;
		}
	}
}
